for j in range(2,1001):
    k = []
    for i in range(1,j):
            if j % i == 0:
                k.append(i) 
    if sum(k)==j:
        print j